import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    hmoe: 0,
    // 登录状态
    login:false,
    //购物车提交按钮
    submit: false,
    token: '',
    slideshowIndex: 1,
    // 购物车id
    shoppingID: 0,
    // 地址信息等
    address: [],
    // 购物车要不的数量的
    shoppingamount: 0,

  },
  mutations: {
    increment(state, scrollTop) {
      state.hmoe = scrollTop
    },

    // 按钮的状态
    tijiao(state, submits) {
      state.submit = submits
    },
    // 拿到购物车id
    shoppingID(state, shoppingIDs) {
      state.shoppingID = shoppingIDs
    },
    // 地址选择的时候进行传值
    address(state, address) {
      state.address = address
    },
    tokens(state, tokenm) {
      state.token = tokenm
    },
    //  购物车数量
    shoppingAmount(state, shoppingamount) {
      state.shoppingamount = shoppingamount
    },
    onlogin(state, loginstate) {
      state.login = loginstate
    }
  },
  actions: {
  },
  modules: {
  }
})
